var a = 0;
var text;
var selects; //记录玩家的选项
var buynum = 0;
var itemlist = Array(
Array(1004156, 200000),
Array(1004193, 40000),
Array(1702567, 40000),
Array(1042342, 40000),
Array(1062226, 40000),
Array(1004405, 40000),
Array(1003748, 40000),
Array(1003279, 40000),
Array(1702490, 40000),
Array(1012517, 20000),
Array(1022043, 20000),
Array(1004665, 40000),
Array(1053006, 40000),
Array(1702640, 40000),
Array(1004639, 40000),
Array(1052997, 40000),
Array(1042120, 40000),
Array(1042121, 40000),
Array(1112172, 40000),
Array(1112171, 40000),
Array(1112143, 40000),
Array(1112177, 40000),
Array(1112179, 40000),
Array(1112193, 40000),
Array(1112199, 40000),
Array(1112198, 40000),
Array(1112197, 40000),
Array(1112254, 40000),
Array(1112284, 40000),
Array(1112283, 40000),
Array(1112289, 40000),
Array(1112288, 50000),
Array(1112291, 40000),
Array(1702433, 50000),
Array(1702533, 50000),
Array(1052762, 40000),
Array(1042025, 40000),
Array(1062027, 40000),
Array(1002720, 40000),
Array(1051410, 40000),
Array(1051070, 40000),
Array(1004279, 40000),
Array(1052634, 40000),
Array(1004589, 40000),
Array(1004197, 40000),
Array(1004169, 40000),
Array(1102605, 60000),
Array(1702553, 40000),
Array(1702473, 40000),
Array(1082631, 40000),
Array(1050342, 40000),
Array(1051440, 40000),
Array(1051434, 40000),
Array(1052842, 40000),
Array(1052843, 40000),
Array(1702625, 40000),
Array(1062214, 40000),
Array(1000084, 40000),
Array(1004298, 40000),
Array(1003831, 40000),
Array(1042086, 40000),
Array(1042093, 40000),
Array(1042329, 40000),
Array(1042333, 40000),
Array(1042334, 40000),
Array(1042348, 40000),
Array(1001005, 40000),
Array(1052709, 40000),
Array(1004095, 40000),
Array(1072911, 40000),
Array(1102671, 40000),
Array(1042122, 40000),
Array(1042100, 40000),
Array(1061126, 40000),
Array(1040129, 40000),
Array(1042092, 40000),
Array(1042159, 40000),
Array(1040123, 40000),
Array(1042105, 40000),
Array(1051139, 40000),
Array(1042294, 40000),
Array(1042067, 40000),
Array(1042278, 40000),
Array(1050318, 40000),
Array(1041114, 40000),
Array(1042037, 40000),
Array(1042036, 40000),
Array(1051362, 40000),
Array(1061007, 40000),
Array(1041104, 40000),
Array(1040027, 40000),
Array(1001094, 40000),
Array(1072388, 40000),
Array(1052296, 40000),
Array(1052295, 40000),
Array(1051185, 40000),
Array(1002976, 40000),
Array(1003147, 40000),
Array(1004482, 40000),
Array(1004483, 40000),
Array(1022247, 40000),
Array(1052951, 40000),
Array(1022004, 40000),
Array(1003998, 40000),
Array(1050314, 40000),
Array(1072876, 40000),
Array(1082565, 40000),
Array(1702468, 40000),
Array(1072749, 40000),
Array(1115009, 40000),
Array(1003192, 40000),
Array(1003193, 40000),
Array(1040154, 40000),
Array(1060145, 40000),
Array(1041156, 40000),
Array(1061166, 40000),
Array(1115009, 40000),
Array(1112196, 40000),
Array(1115007, 40000),
Array(1004510, 40000),
Array(1004513, 40000),
Array(1004511, 40000),
Array(1042183, 40000),
Array(1112149, 40000),
Array(1112100, 40000),
Array(1112161, 40000),
Array(1042182, 40000),
Array(1112007, 80000),
Array(1112823, 80000),
Array(1112812, 80000),
Array(1112312, 80000),
Array(1112802, 80000),
Array(1102724, 150000),
Array(1004471, 40000),
Array(1052209, 40000),
Array(1042333, 40000),
Array(1042339, 40000),
Array(1052910, 40000),
Array(1052911, 40000),
Array(1702124, 40000),
Array(1702579, 40000),
Array(1002227, 40000),
Array(1112958, 40000),
Array(1112959, 40000),
Array(1042350, 40000),
Array(1052083, 40000),
Array(1702226, 40000),
Array(1002592, 30000),
Array(1052084, 30000),
Array(1702112, 40000),
Array(1002559, 40000),
Array(1072280, 40000),
Array(1002607, 40000),
Array(1052094, 40000),
Array(1072284, 40000),
Array(1702123, 40000),
Array(1004167, 50000),
Array(1702577, 40000),
Array(1042329, 40000),
Array(1051389, 40000),
Array(1702608, 40000),
Array(1702611, 40000),
Array(1702607, 40000),
Array(1702597, 40000),
Array(1102841, 40000),
Array(1102845, 40000),
Array(1102853, 40000),
Array(1102844, 40000),
Array(1102854, 40000),
Array(1102855, 40000),
Array(1092054, 40000),
Array(1052968, 40000),
Array(1052969, 40000),
Array(1004568, 40000),
Array(1004572, 40000),
Array(1004573, 40000),
Array(1004583, 40000),
Array(1102787, 40000),
Array(1112745, 40000),
Array(1102355, 40000),
Array(1051276, 40000),
Array(1050226, 40000),
Array(1070024, 40000),
Array(1071036, 40000),
Array(1702347, 40000),
Array(1004488, 20000),
Array(1052747, 40000),
Array(1702556, 40000),
Array(1073027, 40000),
Array(1040001, 40000),
Array(1050360, 40000),
Array(1052903, 40000),
Array(1052916, 40000),
Array(1051430, 40000),
Array(1052761, 40000),
Array(1004486, 40000),
Array(1003643, 40000),
Array(1004488, 40000),
Array(1112955, 40000),
Array(1112945, 40000),
Array(1112940, 40000),
Array(1004543, 20000),
Array(1004556, 20000),
Array(1004545, 30000),
Array(1004546, 30000),
Array(1004547, 30000),
Array(1004455, 30000),
Array(1004501, 30000),
Array(1040194, 30000),
Array(1041196, 30000),
Array(1042332, 30000),
Array(1004455, 30000),
Array(1050364, 30000),
Array(1050366, 30000),
Array(1051434, 30000),
Array(1051436, 30000),
Array(1082443, 30000),
Array(1112190, 30000),
Array(1012527, 30000),
Array(1112180, 30000),
Array(1112293, 30000),
Array(1112292, 30000),
Array(1112190, 30000),
Array(1115003, 30000),
Array(1000079, 20000),
Array(1072829, 20000),
Array(1702277, 20000),
Array(1702468, 30000),
Array(1702491, 30000),
Array(1702186, 30000),
Array(1102620, 30000),
Array(1102491, 30000),
Array(1051235, 30000),
Array(1102232, 30000),
Array(1052474, 30000),
Array(1052643, 30000),
Array(1052474, 30000),
Array(1702576, 30000),
Array(1102816, 30000),
Array(1042350, 30000),
Array(1102822, 30000),
Array(1702598, 30000),
Array(1702587, 30000),
Array(1702585, 30000),
Array(1702574, 30000),
Array(1702586, 30000),
Array(1702591, 30000),
Array(1004337, 20000),
Array(1004336, 20000),
Array(1102767, 20000),
Array(1004450, 20000),
Array(1102766, 20000),
Array(1004140, 20000),
Array(1050209, 20000),
Array(1050293, 20000),
Array(1072913, 20000),
Array(1042345, 20000),
Array(1042436, 20000),
Array(1042341, 20000),
Array(1042342, 20000),
Array(1042279, 20000),
Array(1042280, 20000),
Array(1042281, 20000),
Array(1042282, 20000),
Array(1062226, 20000),
Array(1062227, 20000),
Array(1062211, 20000),
Array(1062212, 20000),
Array(1052852, 20000),
Array(1052853, 20000),
Array(1052655, 20000),
Array(1052587, 20000),
Array(1052586, 20000),
Array(1052438, 20000),
Array(1102819, 30000),
Array(1072841, 30000),
Array(1072842, 30000),
Array(1082588, 30000),
Array(1004393, 30000),
Array(1004394, 30000),
Array(1004395, 30000),
Array(1004396, 30000),
Array(1004406, 30000),
Array(1102780, 30000),
Array(1102781, 20000),
Array(1102782, 20000),
Array(1102783, 20000),
Array(1102784, 20000),
Array(1102785, 20000),
Array(1102786, 20000),
Array(1102788, 20000),
Array(1052870, 20000),
Array(1052871, 20000),
Array(1052873, 20000),
Array(1052874, 20000),
Array(1052876, 20000),
Array(1082493, 20000),
Array(1702581, 30000),
Array(1702554, 30000),
Array(5160035, 15000),
Array(5160036, 15000),
Array(1702466, 20000),
Array(1052750, 40000),
Array(1102684, 40000),
Array(1072925, 30000),
Array(1072924, 40000),
Array(1102631, 40000),
Array(1052749, 40000),
Array(1102682, 40000),
Array(1004136, 40000),
Array(1072010, 30000),
Array(1060001, 30000),
Array(1072538, 20000),
Array(1072803, 20000),
Array(1052595, 40000),
Array(1003803, 30000),
Array(1052594, 40000),
Array(1072791, 20000),
Array(1003802, 30000),
Array(1001083, 20000),
Array(1702334, 20000),
Array(1102583, 20000),
Array(1702480, 20000),
Array(1052439, 40000),
Array(1052408, 32000),
Array(1052727, 22000),
Array(1072808, 25000),
Array(1102676, 25000),
Array(1001095, 25000),
Array(1050310, 25000),
Array(1702485, 25000),
Array(1004200, 25000),
Array(1072862, 20000),
Array(1102644, 20000),
Array(1042159, 20000),
Array(1112263, 15000),
Array(1113021, 20000),
Array(1112151, 15000),
Array(1062171, 20000),
Array(1042285, 20000),
Array(1003892, 22000),
Array(1042275, 25000),
Array(1052656, 25000),
Array(1004124, 25000),
Array(1003953, 20000),
Array(1072919, 25000),
Array(1051366, 20000),
Array(1004125, 20000),
Array(1112155, 20000),
Array(1112162, 10000),
Array(1003713, 20000),
Array(1052550, 20000),
Array(1112267, 20000),
Array(1004203, 20000),
Array(1042240, 20000),
Array(1062172, 20000),
Array(1004117, 20000),
Array(1702509, 20000),
Array(1042315, 20000),
Array(1050319, 20000),
Array(1042316, 20000),
Array(1051390, 20000),
Array(1071076, 20000),
Array(1001097, 20000),
Array(1000074, 20000),
Array(1004200, 20000),
Array(1001076, 20000),
Array(1070059, 20000),
Array(1051392, 20000),
Array(1050299, 20000),
Array(1071078, 20000),
Array(1112236, 20000),
Array(1702013, 20000),
Array(1112126, 20000),
Array(1052782, 20000),
Array(1072543, 20000),
Array(1102726, 20000),
Array(1004204, 20000),
Array(1004205, 20000),
Array(1052781, 20000),
Array(1003950, 20000),
Array(1042214, 20000),
Array(1102142, 20000),
Array(1004126, 20000),
Array(1042311, 20000),
Array(1702374, 20000),
Array(1002846, 20000),
Array(1004158, 20000),
Array(1004114, 20000),
Array(1102697, 20000),
Array(1112943, 20000),
Array(1002598, 20000),
Array(1102688, 20000),
Array(1702512, 15000),
Array(1032234, 15000),
Array(1702459, 20000),
Array(1042321, 20000),
Array(1002967, 20000),
Array(1702508, 20000),
Array(1702233, 20000),
Array(1004025, 20000),
Array(1012253, 20000),
Array(1004093, 20000),
Array(1042312, 20000),
Array(4000897, 15000),
Array(1042313, 15000),
Array(1702334, 15000),
Array(1022194, 15000),
Array(1022217, 15000),
Array(1102669, 15000),
Array(1050152, 3000), //水兵服(男)
Array(1051180, 3000), //水兵服(女)
Array(1042104, 3000), //小绿叶T恤
Array(1042105, 3000), //小红叶T恤
Array(1002845, 3000), //粉红兔耳帽
Array(1052224, 3000), //草莓baby装
Array(1702228, 3000), //可可香蕉
Array(1002721, 3000), //狸毛护耳
Array(1002568, 3000), //手工编织发夹
Array(1702155, 6000), //绚丽彩虹
Array(1042142, 6000), //彩虹条背心
Array(1062093, 6000), //嫩绿休闲短裤
Array(1112904, 6000), //彩虹星环绕戒指
Array(1041142, 6000), //巨星蛋糕吊带
Array(1061148, 6000), //巨星粉色短裙
Array(1702182, 6000), //洛丽波板糖
Array(1002888, 2000), //丝带发箍(红色)
Array(1002890, 2000), //丝带发箍(蓝色)
Array(1052200, 2000), //罗丽粉色娃娃套服
Array(1702208, 2000), //搞怪鳄鱼
Array(1002863, 5000), //小熊熊可爱帽
Array(1052061, 5000), //巴西足球服No.9
Array(1052059, 5000), //法国足球服No.14
Array(1003207, 5000), //胡萝卜兔爆炸头
Array(1702285, 5000), //蓝色蝴蝶结手提包
Array(1012131, 2000), //好白的牙
Array(1702302, 2000), //杯具
Array(1072337, 2000), //喜洋洋拖鞋
Array(1112238, 10000), //水墨花聊天戒指
Array(1112135, 10000), //水墨花名片戒指
Array(1702261, 8000), //樱花棒
Array(1702091, 8000), //网球拍
Array(1702168, 8000), //闪亮圣诞树
Array(1003051, 8000), //小狐狸
Array(1003048, 8000), //圣诞装饰帽
Array(1002995, 5000), //皇家海军帽
Array(1003012, 8000), //嫦娥发式
Array(1002876, 8000), //圣诞红发夹
Array(1002839, 8000), //南瓜棒球帽
Array(1001048, 50000), //鬼娃娃帽
Array(1102225, 6000), //嫦娥披风
Array(1102217, 6000), //九尾披风
Array(1102157, 6000), //傀儡枷锁
Array(1051131, 8000), //圣诞女孩子服
Array(1112916, 10000), //寂寞单身戒指
Array(1012179, 5000), //鹿鼻子
Array(1051152, 5000), //玫瑰红晚宴裙
Array(1112118, 5000), //可乐名片戒指
Array(1112119, 5000), //可乐(Red) 名片戒指
Array(1112120, 5000), //可乐(White) 名片戒指
Array(1112228, 5000), //可乐聊天戒指
Array(1112229, 5000), //可乐(Red)聊天戒指
Array(1112230, 5000),  //可乐(White)聊天戒指
Array(1112103, 5000),
Array(1050210, 5000),
Array(1112141, 5000),
Array(1112252, 5000),
Array(1112253, 5000),
Array(1112142, 5000),
//
Array(1051280, 10000),
Array(1052426, 10000),
Array(1051278, 10000),
Array(1050229, 10000),
Array(1050227, 10000),
Array(1051235, 10000),
Array(1052201, 10000),
Array(1050232, 10000),
Array(1051282, 10000),
Array(1052425, 10000),
Array(1052412, 10000),
Array(1102503, 10000),
Array(1052455, 10000),
Array(1052503, 10000),
Array(1051261, 10000),
Array(1050230, 10000),
Array(1050231, 10000),
Array(1051149, 10000),
Array(1051192, 10000),
Array(1051255, 10000),
Array(1051256, 10000),
Array(1112422, 10000),
Array(1112424, 10000),
Array(1112930, 10000),
Array(1112136, 10000),
Array(1112920, 14000),
Array(1702367, 14000),
Array(1702341, 14000),
Array(1322102, 14000),
Array(1702366, 14000),
Array(1702352, 14000),
Array(1302037, 14000),
Array(1302061, 14000),
Array(1302063, 14000),
Array(1302080, 14000),
Array(1302084, 14000),
Array(1302085, 14000),
Array(1302087, 14000),
Array(1302169, 14000),
Array(1322051, 14000),
Array(1332032, 14000),
Array(1332053, 14000),
Array(1372017, 14000),
Array(1372031, 14000),
Array(1402037, 14000),
Array(1402049, 14000),
Array(1402063, 14000),
Array(1422011, 14000),
Array(1432039, 14000),
Array(1432046, 14000),
Array(1442026, 14000),
Array(1442065, 14000),
Array(1442088, 14000),
Array(1472063, 14000),
Array(1702342, 14000),
Array(1702337, 14000),
Array(1702335, 14000),
Array(1702330, 14000),
Array(1702346, 14000),
Array(1702341, 14000),
Array(1702340, 14000),
Array(1702324, 14000),
Array(1322102, 14000),
Array(1412056, 14000),
Array(1402110, 14000),
Array(1702310, 14000),
Array(1702329, 14000),
Array(1702316, 14000),
Array(1702309, 14000),
Array(1102380, 14000),
Array(1102385, 14000),
Array(1102386, 14000),
Array(1102238, 14000),
Array(1102241, 14000),
Array(1102248, 14000),
Array(1102245, 14000),
Array(1102265, 14000),
Array(1102285, 14000),
Array(1102286, 14000),
Array(1102287, 14000),
Array(1102270, 14000),
Array(1102273, 14000),
Array(1102288, 14000),
Array(1102253, 14000),
Array(1102298, 14000),
Array(1102299, 14000),
Array(1102297, 14000),
Array(1102310, 14000),
Array(1102319, 14000),
Array(1102272, 14000),
Array(1102323, 14000),
Array(1102324, 14000),
Array(1102349, 14000),
Array(1102325, 14000),
Array(1102326, 14000),
Array(1102338, 14000),
Array(1102350, 14000),
Array(1102374, 14000),
Array(1102353, 14000),
Array(1102357, 14000),
Array(1003214, 14000),
Array(1003141, 14000),
Array(1003269, 14000),
Array(1003268, 14000),
Array(1003492, 14000),
Array(1003493, 14000),
Array(1003494, 14000),
Array(1003495, 14000),
Array(1003496, 14000),
Array(1003519, 14000),
Array(1003520, 14000),
Array(1002726, 14000),
Array(1002524, 14000),
Array(1002714, 14000),
Array(1002841, 14000),
Array(1003220, 14000),
Array(1003219, 14000),
Array(1003170, 14000),
Array(1003226, 14000),
Array(1003227, 14000),
Array(1000050, 14000),
Array(1003232, 14000),
Array(1001064, 14000),
Array(1001075, 14000),
Array(1003252, 14000),
Array(1003249, 14000),
Array(1001036, 14000),
Array(1002425, 14000),
Array(1002677, 14000),
Array(1002702, 14000),
Array(1002707, 14000),
Array(1002728, 14000),
Array(1002743, 14000),
Array(1002749, 14000),
Array(1002758, 14000),
Array(1002788, 14000),
Array(1002812, 14000),
Array(1002851, 14000),
Array(1002858, 14000),
Array(1002867, 14000),
Array(1002939, 14000),
Array(1002971, 14000),
Array(1002972, 14000),
Array(1002980, 14000),
Array(1002997, 14000),
Array(1002998, 14000),
Array(1003091, 14000),
Array(1003114, 14000),
Array(1003075, 14000),
Array(1000043, 14000),
Array(1003149, 14000),
Array(1002988, 14000),
Array(1003154, 14000),
Array(1003159, 14000),
Array(1003169, 14000),
Array(1003193, 14000),
Array(1003194, 14000),
Array(1003195, 14000),
Array(1003196, 14000),
Array(1003271, 14000),
Array(1003360, 14000),
Array(1003359, 14000),
Array(1003417, 14000),
Array(1112204, 14000),
Array(1003581, 15000),
Array(1042263, 15000),
Array(1062173, 10000),
Array(1072820, 10000),
Array(1702422, 15000),
Array(1112101, 10000),
Array(1112937, 15000),
Array(1012134, 10000),
Array(1112907, 15000),
Array(1112928, 15000),
Array(1050119, 15000),
Array(1042198, 15000),
Array(1062072, 15000),
Array(1002566, 15000),
Array(1112145, 15000),
Array(1112257, 15000),
Array(1112146, 15000),
Array(1112258, 15000),
Array(1112254, 15000),
Array(1112143, 15000),
Array(1102453, 50000), 
Array(1102450, 50000), 
Array(1102451, 50000), 
Array(1102452, 50000), 
Array(1102511, 50000), 
Array(1102385, 50000), 
Array(1102386, 50000), 
Array(1102487, 50000), 
Array(1082549, 15000),
Array(1082548, 15000),
Array(1072843, 15000),
Array(1072832, 15000),
Array(1062174, 15000),
Array(1042204, 15000),
Array(1012208, 15000),
Array(1012165, 15000),
Array(1012412, 15000),
Array(1012413, 15000),
Array(1702442, 15000),
Array(1702422, 15000),
Array(1702446, 15000),
Array(1702460, 15000),
Array(1702408, 15000),
Array(1702415, 15000),
Array(1702403, 15000),
Array(1702402, 15000),
Array(1702375, 15000),
Array(1702348, 15000),
Array(1003965, 15000),
Array(1003964, 15000),
Array(1003920, 15000),
Array(1003921, 15000),
Array(1003918, 15000),
Array(1003861, 15000),
Array(1003865, 15000),
Array(1003919, 15000),
Array(1102593, 15000),
Array(1102564, 15000),
Array(1102615, 15000),
Array(1052661, 15000),
Array(1042277, 15000),
Array(1060181, 15000),
Array(1052593, 15000),
Array(1052536, 15000),
Array(1050312, 15000),
Array(1042236, 15000),
Array(1042240, 15000),
Array(1062157, 15000),
Array(1042265, 15000),
Array(1042241, 15000),
Array(1062156, 15000),
Array(1042238, 15000),
Array(1040192, 15000),
Array(1041194, 15000),
Array(1003505, 15000),
Array(1003504, 15000),
Array(1061207, 15000)
);


function start() {
    a = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (mode == 1)
            a++;
        else
            a--;
        if (a == -1) {
            cm.dispose();
        } else if (a == 0) {
			text = "#h0#,你好！在这里可以选择你想要购买的漂亮点装,点击图片购买\r\n#b";
			for (var i=0; i<itemlist.length; i++) {
				text += "#L" + i + "##i" + itemlist[i] + "#  ";
				if (i != 0 && (i+1) % 5 == 0) {
					text += "\r\n";
				}
			}
            cm.sendSimple(text);
        } else if (a == 1) {
			selects = selection;
            cm.sendGetNumber("请输入你请你输入想要购买的数量\r\n\r\n#r - 1个需要" + itemlist[selects][1] + "点卷", 0, 0, 999999);
        } else if (a == 2) {
            buynum = selection;
            cm.sendNext("你想购买" + buynum + "个#r#i" + itemlist[selects][0] + "##k？\r\n你将使用掉" + (buynum * itemlist[selects][1]) + "点卷。");
        } else if (a == 3) {
            if (cm.getChar().getCSPoints(1) >= buynum * itemlist[selects][1]) {
                cm.getChar().modifyCSPoints(1, -buynum * itemlist[selects][1]);
                cm.gainItem(itemlist[selects][0], buynum);
                cm.sendOk("购买成功了！");
                cm.dispose();
            } else {
                cm.sendOk("对不起，你没有足够的点卷。");
                cm.dispose();
            }
        }
    }//mode
}//f